#ifndef __GLF_CORE_SPINLOCK_H_INCLUDED__
#define __GLF_CORE_SPINLOCK_H_INCLUDED__

#include <glf/core/macros.h>
#include <glf/core/lockGuard.h>
#include <glf/core/inlines.h>

namespace glf
{

struct SpinLock : private NonCopyable
{
	SpinLock();
	~SpinLock();

	void Lock();
	bool TryLock();
	void Unlock();

	GLF_DECLARE_IMPL(48)
};

typedef LockGuard<SpinLock>    SpinLockScope;
typedef UnlockGuard<SpinLock>  SpinUnlockScope;
typedef TryLockGuard<SpinLock> SpinTryLockScope;

} //namespace glf

#endif //__GLF_CORE_SPINLOCK_H_INCLUDED__
